package project02mutiply;

public class Bus extends Vehicle {
    private  int seat;//座位数
    public Bus() {
    }

    public int getSeat() {
        return seat;
    }

    public void setSeat(int seat) {
        this.seat = seat;
    }

    public Bus(String brand, String license, int dayMoney, int seat) {
        super(brand, license, dayMoney);
        this.seat=seat;
    }

    public void show(){
        String stateString = (state==false)?"当前可租":"当前不可租";
        setType("客车");
        System.out.println(getType()+"\t"+ getBrand()+"\t"+ getLicense()+"\t"
                +getSeat()+"\t"+getDayMoney()+"\t"+stateString);
    }

    public double calculateRent(int day){
        if (day > 3) {
            return day * getDayMoney() * 0.9;
        } else if (day > 7) {
            return day * getDayMoney() * 0.7;
        } else if (day > 30) {
            return day * getDayMoney() * 0.7;
        }else if (day > 150) {
            return day * getDayMoney() * 0.6;
        }
        return day * getDayMoney();
    }

}
